<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增系统参数')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="form-group">
            <label class="col-sm-3 control-label ">参数名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="configName" id="configName" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">参数键值：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="configKey" id="configKey" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">参数值：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="configValue" id="configValue" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">参数类型：</label>
            <div class="col-sm-8">
                <div class="radio-box" >
                    <input type="radio"  name="configType"     value="Y"  checked >  <label>系统内置</label>
                    <input type="radio"  name="configType"      value="N">   <label>非系统内置</label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-9">
                <textarea type="text" name="remark"  class="form-control"  placeholder="请输入参数详情"></textarea>
            </div>
        </div>


    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">



    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
        var configName = $("input[name='configName']").val();
        var configKey = $("input[name='configKey']").val();
        var configValue = $("input[name='configValue']").val();
        var configType = $("input[name='configType']").val();
        var remark = $("input[name='remark']").val();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "cms/config/add",
            data : {
                "configName": configName,
                "configKey": configKey,
                "configValue": configValue,
                "configType": configType,
                "remark": remark,
                "remark": remark
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
</html>